Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.12 #203

Merged
merged 7 commits into from
Oct 2, 2024
Merged

Support Python 3.12 #203

merged 7 commits into from
Oct 2, 2024

Conversation

s0l0ist
Copy link
Contributor

@s0l0ist s0l0ist commented Oct 2, 2024

Description

This PR introduces support for Python 3.12. In earlier versions, the Python bindings did not properly acquire the Global Interpreter Lock (GIL) when returning Python objects, particularly around the GetPrivateKeyBytes pybind11 definitions. Since we are returning a py::bytes object, we should have been acquiring the GIL, but instead, we were incorrectly releasing it.

In previous versions, this behavior could lead to undefined behavior or potential crashes when Python objects were accessed without the GIL being held (although in practice this was not observed). The refactor ensures thread safety by retaining scoped GIL release calls while now correctly acquiring the lock when exceptions are raised back to Python. This improves consistency and correctness when interacting with Python objects.

Also updates the rustc version to the latest (v1.81.0) and PCJ latest changes (removed unused bazel configuration for GRPC)

Affected Dependencies

N/A

How has this been tested?

  • A new test_3_12 bazel test which is now included in CI workflow

Checklist

@s0l0ist s0l0ist merged commit 791d44b into master Oct 2, 2024
21 checks passed
@s0l0ist s0l0ist deleted the nangelou-python-3-12 branch October 2, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant